package com.tqz.juc.threadpool;

import java.util.Deque;
import java.util.LinkedList;
import java.util.Stack;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

/**
 * <p>
 *
 * @author tianqingzhao
 * @since 2022/2/14 21:08
 */
public class FutureTaskTest {
    
    public static void main(String[] args) throws ExecutionException, InterruptedException {
        ExecutorService executorService = Executors.newFixedThreadPool(5);
        Future<?> future = executorService.submit(() -> {
            try {
                Thread.sleep(5000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        });
        System.out.println("111");
        Object obj = future.get();
        System.out.println("222");
    
        Deque<String> deque = new LinkedList<>();
        Stack<String> strings = new Stack<>();
    
        //ForkJoinTask
    }
    
}
